<#assign ctx=request.contextPath />
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>添加</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${ctx}/static/layuiadmin/layui/css/layui.css" media="all">

  <link rel="stylesheet" href="${ctx}/static/layuiadmin/style/admin.css" media="all">
</head>
<body>
<form class="layui-form" action="" id="user">
  <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">

    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-inline">
            <input type="text" name="nickname" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号码</label>
        <div class="layui-input-inline">
            <input type="text" name="phone" lay-verify="required|phone" placeholder="请输入用户名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">登录账号</label>
        <div class="layui-input-inline">
            <input type="text" name="bgLoginName" lay-verify="required" placeholder="请输入登录账号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="password" name="bgPassword" lay-verify="required" placeholder="请输入后台登录密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户权限</label>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select id="role" name="role" lay-verify="" id="role" lay-verify="required" class="layui-input" >
                    <#if (shiro.hasRole("2"))== true >
                        <option value="2">高级管理员</option>
                        <option value="1">普通管理员</option>
                    </#if>
                    <#if (shiro.hasRole("1"))== true >
                        <option value="1">普通管理员</option>
                    </#if>
                    <#if (shiro.hasRole("3"))== true >
                        <option value="3">网站管理员</option>
                    </#if>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
</div>
</form>
  <script src="${ctx}/static/layuiadmin/layui/layui.js"></script>  
  <script>
  var ctx = "${ctx}"
  layui.config({
    base: ctx + '/static/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'upload'], function(){
    var $ = layui.$
    ,form = layui.form
    ,upload = layui.upload ;

    upload.render({
      elem: '#layuiadmin-upload-useradmin'
      ,url: layui.setter.base + 'json/upload/demo.js'
      ,accept: 'images'
      ,method: 'get'
      ,acceptMime: 'image/*'
      ,done: function(res){
        $(this.item).prev("div").children("input").val(res.data.src)
      }
    });
  })
  </script>
</body>
</html>